package com.yangxk.kadmin.web.module.system.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.*;
import java.util.Date;

@Data
public class UserInsertForm {
    @NotBlank(message = "用户名不能为空")
    private String username;

    @NotNull(message = "部门不能为空")
    private Long deptId;

    @Email(message = "邮箱格式错误")
    private String email;

    @NotBlank(message = "手机号不能为空")
    @Pattern(message = "手机号格式错误", regexp = "^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$")
    private String phone;

    @Size(min = 32, max = 32, message = "非法请求")
    private String password;

    private String avatar;

    private String firstName;

    @NotBlank(message = "性别不能为空")
    private String gender;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    @Max(value = 200, message = "备注最多200个字符")
    private String remark;

    private String status;
}
